YES 0.709 H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/Monad.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:



HASKELL
  ↳ LR

mainModule Monad
  ((filterM :: (a  ->  IO Bool ->  [a ->  IO [a]) :: (a  ->  IO Bool ->  [a ->  IO [a])

module Monad where
  import qualified Maybe
import qualified Prelude

  filterM :: Monad b => (a  ->  b Bool ->  [a ->  b [a]
filterM [] return []
filterM p (x : xsp x >>= (\flg ->filterM p xs >>= (\ys ->return ( if flg then x : ys else ys)))


module Maybe where
  import qualified Monad
import qualified Prelude



Lambda Reductions:
The following Lambda expression
\ysreturn (if flg then x : ys else ys)

is transformed to
filterM0 flg x ys = return (if flg then x : ys else ys)

The following Lambda expression
\flgfilterM p xs >>= filterM0 flg x

is transformed to
filterM1 p xs x flg = filterM p xs >>= filterM0 flg x



↳ HASKELL
  ↳ LR
HASKELL
      ↳ IFR

mainModule Monad
  ((filterM :: (a  ->  IO Bool ->  [a ->  IO [a]) :: (a  ->  IO Bool ->  [a ->  IO [a])

module Maybe where
  import qualified Monad
import qualified Prelude


module Monad where
  import qualified Maybe
import qualified Prelude

  filterM :: Monad a => (b  ->  a Bool ->  [b ->  a [b]
filterM [] return []
filterM p (x : xsp x >>= filterM1 p xs x

  
filterM0 flg x ys return ( if flg then x : ys else ys)

  
filterM1 p xs x flg filterM p xs >>= filterM0 flg x



If Reductions:
The following If expression
if flg then x : ys else ys

is transformed to
filterM00 x ys True = x : ys
filterM00 x ys False = ys



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ IFR
HASKELL
          ↳ BR

mainModule Monad
  ((filterM :: (a  ->  IO Bool ->  [a ->  IO [a]) :: (a  ->  IO Bool ->  [a ->  IO [a])

module Monad where
  import qualified Maybe
import qualified Prelude

  filterM :: Monad a => (b  ->  a Bool ->  [b ->  a [b]
filterM [] return []
filterM p (x : xsp x >>= filterM1 p xs x

  
filterM0 flg x ys return (filterM00 x ys flg)

  
filterM00 x ys True x : ys
filterM00 x ys False ys

  
filterM1 p xs x flg filterM p xs >>= filterM0 flg x


module Maybe where
  import qualified Monad
import qualified Prelude



Replaced joker patterns by fresh variables and removed binding patterns.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ IFR
        ↳ HASKELL
          ↳ BR
HASKELL
              ↳ COR

mainModule Monad
  ((filterM :: (a  ->  IO Bool ->  [a ->  IO [a]) :: (a  ->  IO Bool ->  [a ->  IO [a])

module Maybe where
  import qualified Monad
import qualified Prelude


module Monad where
  import qualified Maybe
import qualified Prelude

  filterM :: Monad a => (b  ->  a Bool ->  [b ->  a [b]
filterM vw [] return []
filterM p (x : xsp x >>= filterM1 p xs x

  
filterM0 flg x ys return (filterM00 x ys flg)

  
filterM00 x ys True x : ys
filterM00 x ys False ys

  
filterM1 p xs x flg filterM p xs >>= filterM0 flg x



Cond Reductions:
The following Function with conditions
undefined 
 | False
 = undefined

is transformed to
undefined  = undefined1

undefined0 True = undefined

undefined1  = undefined0 False



↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ IFR
        ↳ HASKELL
          ↳ BR
            ↳ HASKELL
              ↳ COR
HASKELL
                  ↳ Narrow

mainModule Monad
  (filterM :: (a  ->  IO Bool ->  [a ->  IO [a])

module Monad where
  import qualified Maybe
import qualified Prelude

  filterM :: Monad b => (a  ->  b Bool ->  [a ->  b [a]
filterM vw [] return []
filterM p (x : xsp x >>= filterM1 p xs x

  
filterM0 flg x ys return (filterM00 x ys flg)

  
filterM00 x ys True x : ys
filterM00 x ys False ys

  
filterM1 p xs x flg filterM p xs >>= filterM0 flg x


module Maybe where
  import qualified Monad
import qualified Prelude



Haskell To QDPs


↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ IFR
        ↳ HASKELL
          ↳ BR
            ↳ HASKELL
              ↳ COR
                ↳ HASKELL
                  ↳ Narrow
QDP
                      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

new_filterM1(vz3, vz41, vz40, vz5, h) → new_filterM(vz3, vz41, h)
new_filterM(vz3, :(vz40, vz41), h) → new_filterM(vz3, vz41, h)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ HASKELL
  ↳ LR
    ↳ HASKELL
      ↳ IFR
        ↳ HASKELL
          ↳ BR
            ↳ HASKELL
              ↳ COR
                ↳ HASKELL
                  ↳ Narrow
                    ↳ QDP
                      ↳ DependencyGraphProof
QDP
                          ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

new_filterM(vz3, :(vz40, vz41), h) → new_filterM(vz3, vz41, h)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: